﻿Imports System.Data.SqlClient
Imports DESTAJO.ENTIDAD
Imports DESTAJO.USER.CODE


Public Class da_grupo_labor_destajo

    Private oSQL As New DataAccess

    Public Function f_DAO_SelGrupoLabor(ByVal oTransaccion As SqlTransaction, Optional ByRef sError As String = Nothing) As List(Of e_grupo_labor_destajo)

        Dim loE_grupo_labor_destajo As New List(Of e_grupo_labor_destajo)

        Try
            Using con As New SqlConnection(oSQL.fConnection("cnnStringI"))
                con.Open()
                Dim drd As SqlDataReader = oSQL.fSelDrd(con, oTransaccion, "SP_ListarGrupoLabor")
                If drd IsNot Nothing Then
                    If drd.HasRows Then
                        Dim oUCMapeador As New UCMapeador
                        Do While drd.Read
                            Dim oE_grupo_labor_destajo As New e_grupo_labor_destajo
                            oUCMapeador.ReaderToObject(drd, oE_grupo_labor_destajo)
                            loE_grupo_labor_destajo.Add(oE_grupo_labor_destajo)
                        Loop
                    End If
                End If
                Return (loE_grupo_labor_destajo)
            End Using

        Catch ex As Exception
            'Grabar Log
            sError = ex.Message
            Return New List(Of e_grupo_labor_destajo)
        End Try

    End Function

End Class
